import { ApiCall } from "tsrpc";
import { ReqNeverRank, ResNeverRank } from "../../../shared/master/openApi/PtlNeverRank";
import app, { xlsxCfgNames } from "../../../app";
import manage_user from "../../model/manage/manage_user";

export default async function (call: ApiCall<ReqNeverRank, ResNeverRank>) {
  let maps =  [...app.getCfg(xlsxCfgNames.名人堂).values()];
  let randomValue = maps[app.random(0,maps.length-1)];
  let online = await manage_user.locaHas(randomValue.id)

  call.succ({
      qq: randomValue.qq,
      id: randomValue.id,
      res: randomValue.res,
      online:online ? `${online.nickName}` : '离线中',

  })
}